/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package genomemap.netbeans.jobs1;

import cef.command.Command;
import cef.pui.EventConstructionException;
import cef.pui.EventImpl;
import commons.nb.jobs.Job;
import commons.nb.jobs.gui.JobsGUIUtil;
import commons.nb.jobs.properties.BuilderProperty;
import commons.nb.jobs.properties.ComboPropertyImpl;
import genomemap.cef.command.JointMapDistance_Cmd;
import genomemap.cef.command.listener.JointMapDistance_OC;
import genomemap.cef.command.listener.JointMapDistance_PW;
import genomemap.cef.pui.JointMapDistanceEventImpl;

import static genomemap.nb.jobs.properties.Propertys_Gen.BUILDER_DATA_OrganismData;
import static genomemap.nb.jobs.properties.Propertys_Gen.MAPPING_FUNCTIONS;

/**
 *
 *
 * @version 1.3.0
 * @author Susanta Tewari
 * @history Created on 3/17/13
 * @since 1.3.0
 */
public class JointMapDistanceJob extends Job<JointMapDistanceEventImpl> {

    public JointMapDistanceJob() {

        setName("joint-map-distance");
        setDisplayName("Joint Map Distance");
        setShortDescription("Genetic and Physical Map distance");


        // organism data
        final BuilderProperty organism_property = BUILDER_DATA_OrganismData();

        addComboProperty(new ComboPropertyImpl(organism_property));
        addComboProperty(organism_property);


        // mapping functions
        addComboProperty(new ComboPropertyImpl(MAPPING_FUNCTIONS()));


        // listeners
        addCommandOutputListener(new JointMapDistance_PW());
        addCommandOutputListener(JobsGUIUtil.makeEmbeddable(new JointMapDistance_OC()));
    }

    @Override
    protected JointMapDistanceEventImpl createEvent() throws EventConstructionException {
        return new JointMapDistanceEventImpl(getProperties());
    }

    @Override
    protected Command createCommand(final JointMapDistanceEventImpl event) {
        return new JointMapDistance_Cmd(event);
    }

    @Override
    public Class<? extends EventImpl> getEventImplType() {
        return JointMapDistanceEventImpl.class;
    }
}
